snapcraft clean crashes on snapcraft.yaml with bad indent
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
snapcraft felt it was important I share this with you :-)
Running snapcraft on Ubuntu 19.04.
$ snapcraft --version
snapcraft, version 2.43.1+18.10
The log:
$ snapcraft clean
Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft==2.43.1+18.10', 'console_scripts', 'snapcraft')()
...
File "/usr/lib/python3/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
while not self.check_event(MappingEndEvent):
File "/usr/lib/python3/dist-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/usr/lib/python3/dist-packages/yaml/parser.py", line 439, in parse_block_mapping_key
"expected <block end>, but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
in "snapcraft.yaml", line 19, column 3
expected <block end>, but found '<block mapping start>'
in "snapcraft.yaml", line 36, column 4
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.
The snapcraft.yaml provoking the crash (note the inconsistent indent level between the two parts):
name: fpm
version: 1.1
summary: Effing Package Management
description: |
Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
grade: devel
confinement: devmode
apps:
fpm:
environment:
RUBYLIB: $SNAP/usr/lib/ruby/2.3.0:$SNAP/usr/lib/x86_64-linux-gnu/ruby/2.3.0
GEM_HOME: $SNAP/gems
GEM_PATH: $SNAP
command: ruby $SNAP/bin/fpm
parts:
fpm:
source: .
plugin: nil
build-packages:
- build-essential
- ruby-dev
- rubygems-integration
- libreadline-dev
- libssl-dev
- libtinfo-dev
stage-packages:
- ruby
- rubygems-integration
override-build: |
snapcraftctl build
gem install fpm -i $SNAPCRAFT_PART_INSTALL
mangle-shebang:
plugin: nil
after: [fpm]
override-build: |
snapcraftctl build
sed -i 's/#!\/usr\/bin\/ruby/#!\/usr\/bin\/env ruby/' $SNAPCRAFT_STAGE/usr/bin/{gem2.3,rdoc2.3,fpm,rake}
Removing the extra space at the start of the 'mangle-shebang:' line worked around the problem
Evaluation history
No evaluation history available.